<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: 404.php 144 2013-09-22 07:51:14Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 144 $
* 	zuletzt geaendert von:	$Author: siekiera $
* 	Datum:					$Date: 2013-09-22 07:51:14 +0000 (Sun, 22 Sep 2013) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright (c) since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	(c) 2002-2003 osCommerce - www.oscommerce.com
* 	(c) 2003     nextcommerce - www.nextcommerce.org
* 	(c) 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */

if(file_exists('includes/local/configure.php') && filesize('includes/local/configure.php') > 0)
	include('includes/local/configure.php');
elseif(file_exists('includes/configure.php') && filesize('includes/configure.php') > 0)
	include('includes/configure.php');
elseif(!defined('MERCARI_INSTALLED')) {
	header('Location: installer/');
	exit;
} else {
	header('Location: installer/');
	exit;
}

require(DIR_WS_INCLUDES.'database_tables.php');
include(DIR_WS_CLASSES.'class.mercari_db.php');
$db_check = new mercari_db();

$offline = $db_check->db_query("SELECT configuration_value FROM ".TABLE_CONFIGURATION." WHERE configuration_key = 'DOWN_FOR_MAINTENANCE'");

$check = basename($_SERVER['REQUEST_URI']);
if (($offline->fields['configuration_value'] == 'true') && ($check != 'login_offline.php')) {
    header('Location: login_offline.php');
	exit;
}
$db_check->db_close();

header($_SERVER["SERVER_PROTOCOL"].' 404 Not Found');
header('Status: 404 Not Found');

include('includes/application_top.php');

$smarty = new Smarty;

require (DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/source/boxes.php');

$breadcrumb->add('404 - URL nicht gefunden', href_link('404.php', '', 'SSL'));

include ('includes/header.php');

$error_data = $db->db_query("SELECT
								content_title,
								content_heading,
								content_text
							FROM 
								".TABLE_CONTENT_MANAGER."
							WHERE 
								content_group = '11'
							AND 
								languages_id = '".(int)$_SESSION['languages_id']."'");

if($error_data->_numOfRows) {
	$smarty->assign('404_SITE', str_replace(DIR_WS_CATALOG, '', $_GET['error']));
	$smarty->assign('404_TITLE', $error_data->fields['content_heading']);
	$smarty->assign('404_TEXT', $error_data->fields['content_text']);
}
$smarty->assign('FORM_ACTION', draw_form('quick_find', href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'));
$smarty->assign('INPUT_SEARCH', draw_input_field('keywords', '', 'size="40" class="search_field_big" maxlength="40" value="'.BOX_SEARCH_VALUE.'" onblur="if(this.value==\'\') this.value=\''.BOX_SEARCH_VALUE.'\';" onfocus="if(this.value==\''.BOX_SEARCH_VALUE.'\') this.value=\'\';"'));
$smarty->assign('BUTTON_SUBMIT', image_submit('button_quick_find.gif', IMAGE_BUTTON_SEARCH));
$smarty->assign('FORM_END', '</form>');
$smarty->assign('language', $_SESSION['language']);

$smarty->caching = false;
$main_content = $smarty->fetch(CURRENT_TEMPLATE.'/module/404.html');
$smarty->assign('language', $_SESSION['language']);
$smarty->assign('main_content', $main_content);

$smarty->caching = false;
if (!defined('RM'))
	$smarty->loadFilter('output', 'note');
$smarty->loadFilter('output','trimwhitespace');
$smarty->display(CURRENT_TEMPLATE.'/index.html');
include('includes/application_bottom.php');
?>